<?php
/**
 *
 * $Id: helper.php 1.0.0 2012-05-02 06:19:50 Intelygenz $
 * @package	    Intelygenz 
 * @subpackage	Casos
 * @version     1.0.0
 * @description Casos de éxito.
 * @copyright	  Copyright © 2012 - All rights reserved.
 * @license		  GNU General Public License v2.0
 * @author		  Intelygenz
 * @author mail	informacion@intelygenz.com
 * @website		  www.intelygenz.com
  *
 * The module methods
 * -------------------------------
 * getItems()
 *
 */

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
 
/**
 * Example Module Helper
 *
 * @package		  Intelygenz
 * @subpackage	Casos
 * @since 		  1.0.0
 * @class       ModCasosHelper
 */ 
 

JModel::addIncludePath(JPATH_SITE.'/components/com_igzclientes/models','IgzclientesModel');



class ModCasosHelper
{
	/**
	 * Do something getItems method
	 *
	 * @param 	
	 * @return
	 */
    public static function getItems(&$params)
    {
      // Your custom code here
    	$db = JFactory::getDbo();

    	$model = JModel::getInstance('Casos','IgzclientesModel',array('ignore_request'=>true));
    	$app = JFactory::getApplication();
    	$appParams = $app->getParams();
    	$model->setState('params',$appParams);
        //$model->setState('otros',3);
        
    	// Access filter
		$access = !JComponentHelper::getParams('com_igzclientes')->get('show_noauth');
		$authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id'));
		$model->setState('filter.access', $access);

		// Filter by language
		$model->setState('filter.language', $app->getLanguageFilter());

		//  Featured switch
		switch ($params->get('show_featured'))
		{
			case '1':
				$model->setState('filter.featured', 'only');
				break;
			case '0':
				$model->setState('filter.featured', 'hide');
				break;
			default:
				$model->setState('filter.featured', 'show');
				break;
		}
		

		$items = $model->getItems();

		return $items;



    } //end getItems
 
} // END ModCasosHelper

?>